
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

<h:head>
        <link rel="stylesheet" type="text/css" href="#{resource['css:styles.css']}" />    
</h:head>    
    
<ui:composition template="templates/content.xhtml">
    <ui:define name="content">

        <h:body>

            <h:form>
                <p:fileUpload fileUploadListener="#{propertyController.upload}"
                              allowTypes="/(\.|\/)(gif|jpe?g|png)$/" sizeLimit="100000" >

                </p:fileUpload>
            </h:form>

            <br/>

            <h:button id="test" value="Refresh Images" >
                <f:ajax execute="test" event="click" render="images" />
            </h:button><br/><br/>

            <h:panelGroup id="images">
                <ui:repeat value="#{propertyController.getImages()}" var="image">
                    <h:graphicImage value="#{image.getPath()}" />
                </ui:repeat>
            </h:panelGroup>

        </h:body>

    </ui:define>
</ui:composition>
</html>





